package com.bnyy.message.bean.chat;

import com.google.gson.Gson;

import org.xutils.db.annotation.Column;
import org.xutils.db.annotation.Table;

import java.io.Serializable;

/**
 * Author : 关炳鹏
 * Description :
 * Date : 2022/12/29
 **/
@Table(name = "sending_chat_message")
public class SendingChatMessage implements Serializable {

    public interface ColumnName {
        String MSG_ID = "msg_id";
        String MESSAGE = "message";
    }

    @Column(name = ColumnName.MSG_ID)
    private String msgId;
    @Column(name = ColumnName.MESSAGE, isId = true)
    private String message;

    public SendingChatMessage() {
    }

    public SendingChatMessage(ChatMessage chatMessage) {
        this.msgId = chatMessage.getMsgId();
        this.message = new Gson().toJson(chatMessage);
    }

    public String getMsgId() {
        return msgId;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
